
import tkinter as tk
from tkinter import ttk, filedialog

from views import Salary, Attendance, Roster
from views.Home import MainPage

class MultiPageApp(tk.Tk):
    def __init__(self):
        super().__init__()
        self.title("小离的爱心工具箱")
        self.geometry("400x300")

        container = ttk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}
        for F in (MainPage, Roster, Attendance, Salary):
            frame = F(container, self)
            self.frames[F] = frame
            frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame(MainPage)

    def show_frame(self, cont):
        frame = self.frames[cont]
        frame.tkraise()


def main():
    app = MultiPageApp()
    app.mainloop()

if __name__ == "__main__":
    main()